﻿using Microsoft.AspNetCore.Mvc.Rendering;
using PMS.Core.Configuration.CommonEnumConfigs;
using PMS.Web.Framework.Models;
using PMS.Web.Models.Medias;
using System.Collections.Generic;
using System.ComponentModel;

namespace PMS.Web.Models.NaviMenus
{
    /// <summary>
    /// Model For NaviMenu Edit
    /// </summary>
    public partial class NaviMenuEditModel : BaseEntityModel,
        IAclSupportedModel, 
        IStoreMappingSupportedModel
    {
        #region Ctor

        public NaviMenuEditModel()
        {
            IconImageModel = new PictureModel();
            CoverImageModel = new PictureModel();
          
            SelectedTemplateIds = new List<int>();
            AvailableLayoutTemplates = new List<LayoutTemplateSelectModel>();
           
            AvailableParentMenus = new List<SelectListItem>();
            AvailableLanguages = new List<SelectListItem>();
          
            SelectedCustomerRoleIds = new List<int>();
            AvailableCustomerRoles = new List<XMSelectListItem>();

            SelectedStoreIds = new List<int>();
            AvailableStores = new List<XMSelectListItem>();
            
        }
        #endregion

        #region Properties

        #region Properties_MapTo_Entity

        [DisplayName("语言")]
        public string LanguageCode { get; set; }

        [DisplayName("父级菜单")]
        public int ParentId { get; set; }
        public int MenuDepth { get; set; }

        [DisplayName("显示名")]
        public string DisplayName { get; set; }

        [DisplayName("副标题")]
        public string SubTitle { get; set; }

        [DisplayName("描述")]
        public string Description { get; set; }

        [DisplayName("SEO MetaKeywords")]
        public string MetaKeywords { get; set; }

        [DisplayName("SEO MetaDescription")]
        public string MetaDescription { get; set; }

        [DisplayName("SEO MetaTitle")]
        public string MetaTitle { get; set; }

        //PriceRanges Only For MenuGroup.Products
        [DisplayName("价格区间")]
        public string PriceRanges { get; set; }

        [DisplayName("前端显示")]
        public bool ShowOnHomepage { get; set; }

        [DisplayName("页面布局")]
        public LayoutTemplateType LayoutTemplateType { get; set; }
        [DisplayName("列表单页展示条目数")]
        public int PageSize { get; set; }
        [DisplayName("列表可选展示条目数")]
        public string PageSizeOptions { get; set; }

        [DisplayName("导航链接")]
        public string UrlRoute { get; set; }
        [DisplayName("自动配置")]
        public bool BeautifyUrlRoute { get; set; }
        [DisplayName("链接打开方式")]
        public LinkOpenMode UrlTarget { get; set; }
        [DisplayName("排序")]
        public int DisplayOrder { get; set; }

        [DisplayName("状态")]
        public bool IsActive { get; set; }

        #endregion

        public MenuGroups MenuGroup { get; set; }
        public IList<SelectListItem> AvailableLanguages { get; set; }
        //LayoutTemplates
        [DisplayName("页面布局模板")]
        public IList<int> SelectedTemplateIds { get; set; }
        public IList<LayoutTemplateSelectModel> AvailableLayoutTemplates { get; set; }
        [DisplayName("Icon图片")]
        public PictureModel IconImageModel { get; set; }
        [DisplayName("封面图")]
        public PictureModel CoverImageModel { get; set; }
        public string NaviMenuBreadcrumb { get; set; }
        public IList<SelectListItem> AvailableParentMenus { get; set; }

        //ACL (customer roles)
        [DisplayName("ACL")]
        public IList<int> SelectedCustomerRoleIds { get; set; }
        public IList<XMSelectListItem> AvailableCustomerRoles { get; set; }

        //store mapping
        [DisplayName("指定店铺")]
        public IList<int> SelectedStoreIds { get; set; }
        public IList<XMSelectListItem> AvailableStores { get; set; }

        #endregion
    }
}
